package map.tool
{
	import flash.geom.Point;

	public class DistanceToPoint
	{
//-----------------------------------------------------------------------------------------------PUBLIC---------------------------------
													//================ Properties ===============
		public function set zeroPoint(p:Point):void{
			_zeroPoint=p;
		}
													//================ Public Methods ===========
		public function DistanceToPoint(){
			initVar();
		}
		public function transform(aVal:Array):Array{
			var resultArr:Array=new Array();
			var tempX:Number=_zeroPoint.x;
			var tempY:Number=_zeroPoint.y;
			resultArr.push(_zeroPoint);
			for(var i:uint=0;i<aVal[0].length-1;i++){
				tempX+=aVal[0][i];
				tempY+=aVal[1][i];
				var tempP:Point=new Point(tempX,tempY);
				resultArr.push(tempP);				
			}
			return resultArr;
		}
//-----------------------------------------------------------------------------------------------PRIVATE--------------------------------
													
													//================ Properties ===============
		private var _zeroPoint:Point;
													//================ Private Methods ==========
		private function initVar():void{
			_zeroPoint=new Point(0,0);
		}
	}
}